import mock from './base'

mock.post(
  '/mock/user/login',
  mock.ret({
    token: '@string(32)',
    userInfo: {
      name: '@cname',
      avatar: mock.avatar()
    }
  })
)
mock.get(
  '/mock/user/getInfo',
  mock.ret({
    name: '@cname',
    avatar: mock.avatar()
  })
)

mock.post('/mock/user/logout', mock.ret({}))

mock.get(
  '/mock/getMenu',
  mock.ret([
    {
      name: '示例模版',
      path: '/example',
      position: 0,
      sort: 1,
      children: [
        {
          name: '表格信息页',
          path: 'table',
          position: 1,
          sort: 1
        },
        {
          name: '整页表单',
          path: '/form',
          position: 1,
          sort: 1
        },
        {
          name: '对话框表单',
          path: '/dialog_form',
          position: 1,
          sort: 1
        },
        {
          name: '详情展示页',
          path: '/info',
          position: 1,
          sort: 1
        },
        {
          name: '卡片信息展示',
          path: '/card',
          position: 1,
          sort: 1
        }
      ]
    },
    {
      name: '规范说明',
      path: '/specification',
      position: 0,
      sort: 1,
      children: [
        {
          name: '编码规范',
          path: 'table',
          position: 1,
          sort: 1
        },
        {
          name: '接口规范',
          path: '/form',
          position: 1,
          sort: 1
        }
      ]
    }
  ])
)
